package days48;

public class day47 {
    public static int numSubarrayProductLessThanK(int[] nums, int k) {
        int sum = 1;
        int count = 0;
        int i = 0;
        for (int j = 0 ; j < nums.length; j++) {
            sum *= nums[j];
            while (sum >= k && i <= j){
                sum /= nums[i++];
            }
            if(i <= j){
                count = j-i+1;
            }
        }
        return count;
    }

    public static void main(String[] args) {
        numSubarrayProductLessThanK(new int[]{10,5,2,6,100},100);
    }
}
